package com.dao;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Hibernate;
import org.springframework.dao.DataAccessException;

import com.model.Proveedor;
import com.query.ProveedorQuery;

public class ProveedorDAOImpl extends
		BaseHibernateDAO<Proveedor, ProveedorQuery> {

	@Override
	public Class<Proveedor> getModelClass() {
		return Proveedor.class;
	}

	@Override
	public List<String> getListNames() {
		List<String> list = new ArrayList<String>();
		list.add("listaProductoCodigo");
		return list;
	}

	
	@Override
	public Proveedor findInitialize(Long id) throws DataAccessException { 
		Proveedor unProveedor = super.find((Long)id);
		Hibernate.initialize(unProveedor.getListaProductoCodigo());
		return unProveedor;
	}
	
}
